package org.wattdepot.gdata.kukuicup.updater.energybaselines;

import static org.junit.Assert.assertEquals;
import org.junit.Test;

/**
 * Just checking to see that the BaselineDataSet computes averages correctly.
 * @author Philip Johnson
 */
public class TestBaselineDataSet {

  /**
   * Check a few values. 
   */
  @Test
  public void testDataSet() {
    BaselineDataSet data = new BaselineDataSet();
    data.add(1, 1);
    data.add(2, 1);
    data.add(2, 2);
    assertEquals("Checking average 1", 1, data.getAverage(1), 0.001);
    assertEquals("Checking average 2", 1.5, data.getAverage(2), 0.001);
    assertEquals("Checking average 3", 0, data.getAverage(3), 0.001);
  }

}
